<?php
require(dirname(__FILE__) .'/check.php');
$skin->CheckIframe();


/* **** 版权所有 ****

 程序开发：网钛科技
 网钛CMS官网：http://otcms.com
 网钛IDC官网：http://idccms.com
 ＱＱ：877873666
 微信：QQ877873666
 邮箱：877873666@qq.com

 **** 版权所有 **** */


//打开用户表，并检测用户是否登录
$MB->Open('','login');

$skin->WebTop();


echo('
<script language="javascript" type="text/javascript" src="js/inc/list.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/users.js?v='. OT_VERSION .'"></script>
');


$userSysArr = Cache::PhpFile('userSys');

//$dataTypeCN = '会员';


switch ($mudi){
	case 'add':
		$MB->IsSecMenuRight('alertBack',184,$dataType);
		AddOrRev();
		break;

	case 'rev':
		$MB->IsSecMenuRight('alertBack',187,$dataType);
		AddOrRev();
		break;

	case 'manage':
		$MB->IsSecMenuRight('alertBack',185,$dataType);
		manage();
		break;

	case 'recom':
		$MB->IsSecMenuRight('alertBack',185,$dataType);
		AppRecom::AdmManage();
		break;

	case 'qiandao':
		$MB->IsSecMenuRight('alertBack',185,$dataType);
		AppQiandao::AdmManage();
		break;

	case 'gain':
		$MB->IsSecMenuRight('alertBack',185,$dataType);
		AppGain::AdmManage();
		break;

	case 'online':
		$MB->IsSecMenuRight('alertBack',185,$dataType);
		online();
		break;

	case 'show':
		$MB->IsSecMenuRight('alertClose',186,$dataType);
		show();
		break;

	default:
		die('err');
}

$skin->WebBottom();

$MB->Close();
$DB->Close();





// 添加/修改会员
function AddOrRev(){
	global $DB,$skin,$mudi,$dataType,$dataTypeCN,$userSysArr;

	$regScoreArr = Users::ScoreArr('reg');

	$dataMode		= OT::GetStr('dataMode');
	$dataModeStr	= OT::GetStr('dataModeStr');
	$backURL		= OT::GetStr('backURL');
	$dataID			= OT::GetInt2( OT::ParaArr('id') );

	$trTypeStr = '';
	if ($mudi == 'rev'){
		$revexe = $DB->query('select * from '. OT_dbPref .'users where UE_ID='. $dataID);
		if (! $row = $revexe->fetch()){
			JS::AlertBackEnd('无该记录！');
		}
		$UE_ID			= $row['UE_ID'];
		$UE_regType		= $row['UE_regType'];
		$UE_username	= $row['UE_username'];
		$UE_mail		= $row['UE_mail'];
		$UE_question	= $row['UE_question'];
		$UE_realname	= $row['UE_realname'];
		$UE_groupID		= $row['UE_groupID'];
		$UE_isGroupTime	= $row['UE_isGroupTime'];
		$UE_groupTime	= $row['UE_groupTime'];
		$UE_authStr		= $row['UE_authStr'];
		$UE_sex			= $row['UE_sex'];
		$UE_city		= $row['UE_city'];
		$UE_address		= $row['UE_address'];
		$UE_postCode	= $row['UE_postCode'];
		$UE_phone		= $row['UE_phone'];
		$UE_fax			= $row['UE_fax'];
		$UE_qq			= $row['UE_qq'];
		$UE_ww			= $row['UE_ww'];
		$UE_weixin		= $row['UE_weixin'];
		$UE_alipay		= $row['UE_alipay'];
		$UE_web			= $row['UE_web'];
		$UE_note		= $row['UE_note'];
		$UE_adminNote	= $row['UE_adminNote'];
		$UE_event		= $row['UE_event'];
		$UE_state		= $row['UE_state'];
		$UE_pageNum		= $row['UE_pageNum'];
		$UE_pageWapNum	= $row['UE_pageWapNum'];
		$UE_score1		= $row['UE_score1'];
		$UE_score2		= $row['UE_score2'];
		$UE_score3		= $row['UE_score3'];
		$UE_cardType	= $row['UE_cardType'];
		$UE_cardUser	= $row['UE_cardUser'];
		$UE_cardID		= $row['UE_cardID'];
		$UE_cardImg		= $row['UE_cardImg'];
		$UE_cardImg2	= $row['UE_cardImg2'];
		$UE_cardState	= $row['UE_cardState'];
		$UE_recomId		= $row['UE_recomId'];
		$UE_recomUser	= $row['UE_recomUser'];
		$UE_recomNum1	= $row['UE_recomNum1'];
		$UE_recomNum11	= $row['UE_recomNum11'];
		$UE_qiandaoTime	= $row['UE_qiandaoTime'];
		$UE_qiandaoNum	= $row['UE_qiandaoNum'];
		$UE_qiandaoTotal= $row['UE_qiandaoTotal'];
		/*
		$UE_score4			= $row['UE_score4'];
		$UE_score5			= $row['UE_score5'];
		$UE_douyin			= $row['UE_douyin'];
		$UE_appCode			= $row['UE_appCode'];
		$UE_qrImg			= $row['UE_qrImg'];
		$UE_isAgent			= $row['UE_isAgent'];
		$UE_weixinUser		= $row['UE_weixinUser'];
		$UE_weixinOpenid	= $row['UE_weixinOpenid'];
		$UE_weixinUnionid	= $row['UE_weixinUnionid'];
		*/

		$isRevScore		= 0;
		$isRevQiandao	= 0;
		$isRevRecom		= 0;
		unset($revexe);

		$trTypeStr = '
			<tr>
				<td align="right" style="width:120px;">类型：</td>
				<td>'. Users::RegTypeCN($UE_regType) .'</td>
			</tr>
			';

		$mudiCN = '修改';
	}else{
		$UE_ID			= 0;
		$UE_regType		= '';
		$UE_username	= '';
		$UE_mail		= '';
		$UE_question	= '';
		$UE_realname	= '';
		$UE_groupID		= $userSysArr['US_regGroupID'];
		$UE_isGroupTime	= 0;
		$UE_groupTime	= '';
		$UE_authStr		= '';
		$UE_sex			= '';
		$UE_city		= '';
		$UE_address		= '';
		$UE_postCode	= '';
		$UE_phone		= '';
		$UE_fax			= '';
		$UE_qq			= '';
		$UE_ww			= '';
		$UE_weixin		= '';
		$UE_alipay		= '';
		$UE_web			= '';
		$UE_note		= '';
		$UE_adminNote	= '';
		$UE_event		= '';
		$UE_state		= 1;
		$UE_pageNum		= 20;
		$UE_pageWapNum	= 20;
		$UE_score1		= $regScoreArr['US_score1'];
		$UE_score2		= $regScoreArr['US_score2'];
		$UE_score3		= $regScoreArr['US_score3'];
		$UE_cardType	= '';
		$UE_cardUser	= '';
		$UE_cardID		= '';
		$UE_cardImg		= '';
		$UE_cardImg2	= '';
		$UE_cardState	= 0;
		$UE_recomId		= 0;
		$UE_recomUser	= '';
		$UE_recomNum1	= 0;
		$UE_recomNum11	= 0;
		$UE_qiandaoTime	= '';
		$UE_qiandaoNum	= '';
		$UE_qiandaoTotal= '';
		$isRevScore		= 1;
		$isRevQiandao	= 0;
		$isRevRecom		= 0;

		$mudiCN = '添加';
	}

	$todayTime = TimeDate::Get();
	$todayWeek = TimeDate::Add('d',7,$todayTime);
	$todayMonth = TimeDate::Add('d',31,$todayTime);
	$today3Month = TimeDate::Add('d',93,$todayTime);
	$todayYear = TimeDate::Add('y',1,$todayTime);

	echo(
	AdmArea::TopBackBtn('users.php?mudi=manage&dataMode='. $dataMode .'&dataModeStr='. $dataModeStr .'&dataType='. $dataType .'&dataTypeCN='. urlencode('会员'), '返回 会员管理') .'
	
	<form id="dealForm" name="dealForm" method="post" action="users_deal.php?mudi='. $mudi .'&nohrefStr=close" onsubmit="return CheckForm()">
	<input type="hidden" id="dataType" name="dataType" value="'. $dataType .'" />
	<input type="hidden" id="dataTypeCN" name="dataTypeCN" value="'. $dataTypeCN .'" />
	<input type="hidden" id="dataMode" name="dataMode" value="'. $dataMode .'" />
	<input type="hidden" id="dataModeStr" name="dataModeStr" value="'. $dataModeStr .'" />
	<input type="hidden" id="dataID" name="dataID" value="'. $dataID .'" />
	<input type="hidden" id="recomUserOld" name="recomUserOld" value="'. $UE_recomUser .'" />
	'. Area::BackUrlInput($backURL) .'
	');

	$skin->TableTop('share_'. $mudi .'.gif','',$mudiCN . $dataTypeCN .'资料');
		echo('
		<table style="width:99%;" align="center" cellpadding="0" cellspacing="0" summary="" class="padd3">
		'. $trTypeStr .'
		<tr>
			<td align="right" style="width:120px;">'. Skin::RedSign() .'会员组：</td>
			<td>
				<select id="groupID" name="groupID">
				');

				$gexe=$DB->query('select UG_ID,UG_theme from '. OT_dbPref .'userGroup where UG_state=1 order by UG_rank ASC');
				while ($row = $gexe->fetch()){
					echo('<option value="'. $row['UG_ID'] .'" '. Is::Selected($UE_groupID,$row['UG_ID']) .'>'. $row['UG_theme'] .'</option>');
				}
				unset($gexe);

				echo('
				</select>&ensp;
				<label><input type="checkbox" id="isGroupTime" name="isGroupTime" value="1" '. Is::Checked($UE_isGroupTime,1) .' onclick="CheckGroupTime()" />开启到期时间</label>
			</td>
		</tr>
		<tr id="groupTimeBox" style="display:none;">
			<td align="right">'. Skin::RedSign() .'会员组到期时间：</td>
			<td align="left">
				<input type="text" id="groupTime" name="groupTime" size="22" style="width:170px;" value="'. $UE_groupTime .'" onfocus=\'WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"})\' class="Wdate" />&ensp;&ensp;
				<input type="button" value="7天" onclick=\'$id("groupTime").value = "'. $todayWeek .'"\' />&ensp;&ensp;
				<input type="button" value="31天" onclick=\'$id("groupTime").value = "'. $todayMonth .'"\' />&ensp;&ensp;
				<input type="button" value="93天" onclick=\'$id("groupTime").value = "'. $today3Month .'"\' />&ensp;&ensp;
				<input type="button" value="1年" onclick=\'$id("groupTime").value = "'. $todayYear .'"\' />&ensp;&ensp;
				'. (empty($UE_groupTime) == false ? '<span style="color:red;">['. TimeDate::Get('date',$UE_groupTime) .'&ensp;'. TimeDate::DiffDayCN($UE_groupTime,'还剩') .']</span>' : '') .'
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'用户名：</td>
			<td>
				<input type="text" id="username" name="username" size="25" style="width:300px;" value="'. $UE_username .'" onblur=\'CheckUsername("username",this.value)\' />
				<span id="usernameIsOk"></span>
				<span id="usernameStr"></span>
			</td>
		</tr>
		<tr>
			<td align="right">'. ($mudi == 'rev' ? '' : Skin::RedSign()) .'登录密码：</td>
			<td><input type="text" id="userpwd" name="userpwd" size="25" style="width:300px;" /><span class="font2_2">&ensp;不改密码请留空</span></td>
		</tr>
		<tr>
			<td align="right">密保问题：</td>
			<td><input type="text" id="question" name="question" size="25" style="width:300px;" value="'. $UE_question .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">密保答案：</td>
			<td><input type="text" id="answer" name="answer" size="25" style="width:300px;" /><span class="font2_2">&ensp;不改答案请留空</span></td>
		</tr>
		<tr>
			<td align="right">昵称：</td>
			<td style="padding:3px"><input type="text" id="realname" name="realname" size="25" style="width:300px;" value="'. $UE_realname .'" /></td>
		</tr>
		<tr>
			<td align="right">邮箱：</td>
			<td>
				<input type="text" id="mail" name="mail" size="25" style="width:300px;" value="'. $UE_mail .'" />&ensp;
				<label><input type="checkbox" name="authStr[]" value="|邮箱|" '. Is::InstrChecked($UE_authStr,'|邮箱|') .' />邮箱已验证</label>
				&ensp;<input type="button" value="使用QQ邮箱" onclick="LoadQQmail()" />
			</td>
		</tr>
		<tr>
			<td align="right">手机：</td>
			<td>
				<input type="text" id="phone" name="phone" size="25" style="width:300px;" value="'. $UE_phone .'" />&ensp;
				<label><input type="checkbox" name="authStr[]" value="|手机|" '. Is::InstrChecked($UE_authStr,'|手机|') .' />手机已验证</label>
			</td>
		</tr>
		<tr>
			<td align="right">QQ：</td>
			<td>
				<input type="text" id="qq" name="qq" size="25" style="width:300px;" value="'. $UE_qq .'" /><!-- &ensp;
				<label><input type="checkbox" name="authStr[]" value="|QQ|" '. Is::InstrChecked($UE_authStr,'|QQ|') .' />QQ已验证</label> -->
				<span class="font2_2">&ensp;如多个QQ用逗号“,”隔开</span>
			</td>
		</tr>
		<tr>
			<td align="right">旺旺：</td>
			<td><input type="text" id="ww" name="ww" size="25" style="width:300px;" value="'. $UE_ww .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">微信：</td>
			<td><input type="text" id="weixin" name="weixin" size="25" style="width:300px;" value="'. $UE_weixin .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">支付宝：</td>
			<td><input type="text" id="alipay" name="alipay" size="25" style="width:300px;" value="'. $UE_alipay .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">实名状态：</td>
			<td>
				<label><input type="radio" name="cardState" value="0" '. Is::Checked($UE_cardState,0) .' />未提交</label>&ensp;&ensp;
				<label><input type="radio" name="cardState" value="2" '. Is::Checked($UE_cardState,2) .' />待审核</label>&ensp;&ensp;
				<label style="color:green;"><input type="radio" name="cardState" value="1" '. Is::Checked($UE_cardState,1) .' />手动审核通过</label>&ensp;&ensp;
				<label style="color:green;"><input type="radio" name="cardState" value="11" '. Is::Checked($UE_cardState,11) .' />微信实名</label>&ensp;&ensp;
				<label style="color:green;"><input type="radio" name="cardState" value="21" '. Is::Checked($UE_cardState,21) .' />支付宝实名</label>&ensp;&ensp;
				<label style="color:red;"><input type="radio" name="cardState" value="3" '. Is::Checked($UE_cardState,3) .' />审核拒绝</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right" style="width:120px;">实名认证类型：</td>
			<td>
				<select id="cardType" name="cardType">
					<option value=""></option>
					<option value="身份证" '. Is::Selected($UE_cardType,'身份证') .'>身份证</option>
					<option value="营业执照" '. Is::Selected($UE_cardType,'营业执照') .'>营业执照</option>
					<option value="其他" '. Is::Selected($UE_cardType,'其他') .'>其他</option>
				</select>&ensp;
			</td>
		</tr>
		<tr>
			<td align="right">实名姓名/公司名：</td>
			<td>
				<input type="text" id="cardUser" name="cardUser" size="25" style="width:300px;" value="'. $UE_cardUser .'" />&ensp;
			</td>
		</tr>
		<tr>
			<td align="right">实名身份证号/税号：</td>
			<td><input type="text" id="cardID" name="cardID" size="25" style="width:300px;" value="'. $UE_cardID .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">实名身份证/营业照：</td>
			<td>
				<input type="text" id="cardImg" name="cardImg" size="25" style="width:300px;" value="'. $UE_cardImg .'" />
				<input type="button" onclick=\'OT_OpenUpImg("input","cardImg","users","")\' value="上传图片" />
				'. (strlen($UE_cardImg)>0 ? '&ensp;&ensp;&ensp;&ensp;<a href="'. Info::InfoImgUrl($UE_cardImg,UsersFileAdminDir) .'" target="_blank" title="点击看原图" style="color:red;">【点击查看图片】</a>' : '') .'
			</td>
		</tr>
		<tr>
			<td align="right">实名其他信息：</td>
			<td>
				<input type="text" id="cardImg2" name="cardImg2" size="25" style="width:300px;" value="'. $UE_cardImg2 .'" />
				<input type="button" onclick=\'OT_OpenUpImg("input","cardImg2","users","")\' value="上传图片" />
				'. (strlen($UE_cardImg2)>0 ? '&ensp;&ensp;&ensp;&ensp;<a href="'. Info::InfoImgUrl($UE_cardImg2,UsersFileAdminDir) .'" target="_blank" title="点击看原图" style="color:red;">【点击查看图片】</a>' : '') .'
			</td>
		</tr>
		<tr>
			<td align="right">性别：</td>
			<td>
				<label><input type="radio" name="sex" value="男" '. Is::Checked($UE_sex,'男') .' />男</label>&ensp;&ensp;
				<label><input type="radio" name="sex" value="女" '. Is::Checked($UE_sex,'女') .' />女</label>
			</td>
		</tr>
		<tr>
			<td align="right">城市：</td>
			<td><input type="text" id="city" name="city" size="25" style="width:300px;" value="'. $UE_city .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">收货地址：</td>
			<td><input type="text" id="address" name="address" size="25" style="width:300px;" value="'. $UE_address .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">邮编：</td>
			<td><input type="text" id="postCode" name="postCode" size="25" style="width:300px;" value="'. $UE_postCode .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right">网址：</td>
			<td><input type="text" id="web" name="web" size="25" style="width:300px;" value="'. $UE_web .'" />&ensp;</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="margin-top:6px;">前台备注：</td>
			<td><textarea id="note" name="note" style="width:300px;height:60px;" >'. $UE_note .'</textarea>&ensp;（前台会员看到）</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="margin-top:6px;">内部备注：</td>
			<td><textarea id="adminNote" name="adminNote" style="width:300px;height:60px;" >'. $UE_adminNote .'</textarea>&ensp;（仅限后台看到）</td>
		</tr>
		<tr>
			<td align="right">PC列表页数：</td>
			<td><input type="text" id="pageNum" name="pageNum" size="25" style="width:60px;" value="'. $UE_pageNum .'" /></td>
		</tr>
		<tr>
			<td align="right">WAP列表页数：</td>
			<td><input type="text" id="pageWapNum" name="pageWapNum" size="25" style="width:60px;" value="'. $UE_pageWapNum .'" /></td>
		</tr>
		<tr>
			<td align="right">状态：</td>
			<td>
				<label><input type="radio" name="state" value="1" '. Is::Checked($UE_state,1) .' />已审核</label>&ensp;&ensp;
				<label><input type="radio" name="state" value="0" '. Is::Checked($UE_state,0) .' />未审核</label>&ensp;&ensp;
				<label><input type="radio" name="state" value="9" '. Is::Checked($UE_state,9) .' />冻结</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right" style="color:red;">修改积分：</td>
			<td>
				<label><input type="radio" id="isRevScore1" name="isRevScore" value="1" '. Is::Checked($isRevScore,1) .' onclick="CheckScoreBox();" />是</label>&ensp;&ensp;
				<label><input type="radio" id="isRevScore0" name="isRevScore" value="0" '. Is::Checked($isRevScore,0) .' onclick="CheckScoreBox();" />否</label>
			</td>
		</tr>
		<tbody id="scoreBox">
		');
		if ($mudi == 'rev' && AppUserScore::Jud()){
			echo('
			<tr>
				<td align="right"></td>
				<td><div style="color:blue;cursor:pointer;" onclick=\'OT_OpenUserScore("&userID='. $UE_ID .'")\'>[积分管理]</div></td>
			</tr>
			');
		}
		if ($userSysArr['US_isScore1']==1){
			echo('
			<tr>
				<td align="right">'. $userSysArr['US_score1Name'] .'：</td>
				<td>
					<input type="hidden" id="scoreOld1" name="scoreOld1" value="'. $UE_score1 .'" />
					<input type="text" id="score1" name="score1" size="25" style="width:60px;" value="'. $UE_score1 .'" />
				</td>
			</tr>
			');
		}
		if ($userSysArr['US_isScore2']==1){
			echo('
			<tr>
				<td align="right">'. $userSysArr['US_score2Name'] .'：</td>
				<td>
					<input type="hidden" id="scoreOld2" name="scoreOld2" value="'. $UE_score2 .'" />
					<input type="text" id="score2" name="score2" size="25" style="width:60px;" value="'. $UE_score2 .'" />
				</td>
			</tr>
			');
		}
		if ($userSysArr['US_isScore3']==1){
			echo('
			<tr>
				<td align="right">'. $userSysArr['US_score3Name'] .'：</td>
				<td>
					<input type="hidden" id="scoreOld3" name="scoreOld3" value="'. $UE_score3 .'" />
					<input type="text" id="score3" name="score3" size="25" style="width:60px;" value="'. $UE_score3 .'" />
				</td>
			</tr>
			');
		}
		echo('
		</tbody>
		');

		if (AppQiandao::Jud()){
			echo('
			<tr>
				<td align="right" style="color:red;">修改签到信息：</td>
				<td>
					<label><input type="radio" id="isRevQiandao1" name="isRevQiandao" value="1" '. Is::Checked($isRevQiandao,1) .' onclick="CheckQiandaoBox();" />是</label>&ensp;&ensp;
					<label><input type="radio" id="isRevQiandao0" name="isRevQiandao" value="0" '. Is::Checked($isRevQiandao,0) .' onclick="CheckQiandaoBox();" />否</label>
				</td>
			</tr>
			<tbody id="qiandaoBox">
			<tr>
				<td align="right">最后签到时间：</td>
				<td><input type="text" id="qiandaoTime" name="qiandaoTime" size="22" style="width:170px;" value="'. $UE_qiandaoTime .'" onfocus=\'WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"})\' class="Wdate" /></td>
			</tr>
			<tr>
				<td align="right">连续签到次数：</td>
				<td><input type="text" id="qiandaoNum" name="qiandaoNum" size="25" style="width:60px;" value="'. $UE_qiandaoNum .'" />
				</td>
			</tr>
			<tr>
				<td align="right">签到总次数：</td>
				<td><input type="text" id="qiandaoTotal" name="qiandaoTotal" size="25" style="width:60px;" value="'. $UE_qiandaoTotal .'" />
				</td>
			</tr>
			</tbody>
			');
		}

		if (AppRecom::Jud()){
			if ($UE_recomNum1 > 0){
				echo('
				<tr>
					<td align="right" style="color:red;">邀请人：</td>
					<td>'. $UE_recomUser .'（已邀请下级'. $UE_recomNum1 .'人，其中有效'. $UE_recomNum11 .'人，禁止修改）</td>
				</tr>
				');
			}else{
				echo('
				<tr>
					<td align="right" style="color:red;">修改邀请人：</td>
					<td>
						<label><input type="radio" id="isRevRecom1" name="isRevRecom" value="1" '. Is::Checked($isRevRecom,1) .' onclick="CheckRecomBox();" />是</label>&ensp;&ensp;
						<label><input type="radio" id="isRevRecom0" name="isRevRecom" value="0" '. Is::Checked($isRevRecom,0) .' onclick="CheckRecomBox();" />否</label>
					</td>
				</tr>
				<tbody id="recomBox">
				<tr>
					<td align="right" valign="top" style="padding-top:6px;">邀请人：</td>
					<td>
						<input type="text" id="recomUser" name="recomUser" size="25" style="width:150px;" value="'. $UE_recomUser .'" />&ensp;
						<input type="button" value="选择邀请人" onclick="OpenSelUserBox(\'recomUser\',\'username\',\'users\')" /><!-- 文本框ID，调用字段名，表名 -->
						<span id="usernameRes" style="color:red;"></span>
						<span id="selUserBox" style="display:none;"></span>
					</td>
				</tr>
				</tbody>
				');
			}		
		}

		echo('
		</table>
		');
	$skin->TableBottom();

	echo('
	<table style="height:16px;" cellpadding="0" cellspacing="0" summary=""><tr><td></td></tr></table>

	<center><input type="image" src="'. AdmTpl::ImgSrc('button_'. $mudi) .'" /></center>

	</form>
	');

}



// 管理
function manage(){
	global $DB,$MB,$skin,$mudi,$dataType,$dataTypeCN,$pageCount,$recordCount,$userSysArr;

	$dataMode		= OT::GetStr('dataMode');
	$dataModeStr	= OT::GetStr('dataModeStr');

	$refGroupID		= OT::GetInt('refGroupID');
	$refUsername	= OT::GetRegExpStr('refUsername','sql');
	$refIsFullName	= OT::GetInt('refIsFullName');
	$refRealname	= OT::GetRegExpStr('refRealname','sql');
	$refMail		= OT::GetRegExpStr('refMail','sql+mail');
	$refAuthMail	= OT::GetInt('refAuthMail');
	$refPhone		= OT::GetRegExpStr('refPhone','sql');
	$refAuthPhone	= OT::GetInt('refAuthPhone');
	$refShiming		= OT::GetRegExpStr('refShiming','sql');
	$refCardState	= OT::GetInt('refCardState',-1);
	$refqq			= OT::GetRegExpStr('refqq','sql');
	$refww			= OT::GetRegExpStr('refww','sql');
	$refRegType		= OT::GetRegExpStr('refRegType','sql');
	$refRegIP		= OT::GetRegExpStr('refRegIP','sql+.');
	$refState		= OT::GetInt('refState',-1);
	$refMailMode	= OT::GetRegExpStr('refMailMode','sql');
	$refPhoneMode	= OT::GetRegExpStr('refPhoneMode','sql');
	$refMark		= OT::GetInt('refMark');
	$refNoMail		= OT::GetInt('refNoMail');
	$refNoPhone		= OT::GetInt('refNoPhone');
	$refNoWeixin	= OT::GetInt('refNoWeixin');
	$refApiQq		= OT::GetInt('refApiQq');
	$refApiWeibo	= OT::GetInt('refApiWeibo');
	$refApiWeixin	= OT::GetInt('refApiWeixin');
	$refApiWxmp		= OT::GetInt('refApiWxmp');
	$refMoney_1		= OT::GetInt('refMoney_1',-1);
	$refMoney_2		= OT::GetInt('refMoney_2',-1);
	$refScore1_1	= OT::GetInt('refScore1_1',-1);
	$refScore1_2	= OT::GetInt('refScore1_2',-1);
	$refScore2_1	= OT::GetInt('refScore2_1',-1);
	$refScore2_2	= OT::GetInt('refScore2_2',-1);
	$refScore3_1	= OT::GetInt('refScore3_1',-1);
	$refScore3_2	= OT::GetInt('refScore3_2',-1);
	$refGroupDate1	= OT::GetStr('refGroupDate1');
		if (! strtotime($refGroupDate1)){ $refGroupDate1=''; }
	$refGroupDate2	= OT::GetStr('refGroupDate2');
		if (! strtotime($refGroupDate2)){ $refGroupDate2=''; }
	$refDate1		= OT::GetStr('refDate1');
		if (! strtotime($refDate1)){ $refDate1=''; }
	$refDate2		= OT::GetStr('refDate2');
		if (! strtotime($refDate2)){ $refDate2=''; }
	$refLoginDate1	= OT::GetStr('refLoginDate1');
		if (! strtotime($refLoginDate1)){ $refLoginDate1=''; }
	$refLoginDate2	= OT::GetStr('refLoginDate2');
		if (! strtotime($refLoginDate2)){ $refLoginDate2=''; }
	$refListMode	= OT::GetStr('refListMode');
		$listModeArr = array('shiming');
		if (! in_array($refListMode, $listModeArr)){ $refListMode = 'def'; }

	$SQLstr='select * from '. OT_dbPref .'users where 1=1';

	if ($refGroupID > 0){ $SQLstr .= ' and UE_groupID='. $refGroupID .''; }
	if ($refState >= 0){ $SQLstr .= ' and UE_state='. $refState .''; }
	if ($refUsername != ''){
		if ($refIsFullName == 1){
			$SQLstr .= " and UE_username=". $DB->ForStr($refUsername);
		}else{
			$SQLstr .= " and UE_username like '%". $refUsername ."%'";
		}
	}
	if ($refRealname != ''){ $SQLstr .= " and UE_realname like '%". $refRealname ."%'"; }
	if ($refMail != ''){ $SQLstr .= " and UE_mail like '%". $refMail ."%'"; }
	if ($refAuthMail == 1){ $SQLstr .= " and UE_authStr like '%|邮箱|%'"; }
	if ($refPhone != ''){ $SQLstr .= " and UE_phone like '%". $refPhone ."%'"; }
	if ($refAuthPhone == 1){ $SQLstr .= " and UE_authStr like '%|手机|%'"; }
	if ($refShiming != ''){ $SQLstr .= " and UE_cardUser like '%". $refShiming ."%'"; }
	if ($refCardState >= 0){
		if ($refCardState == 99){
			$SQLstr .= " and (length(UE_cardUser)>=1 or length(UE_cardID)>=1)";
		}elseif ($refCardState == 98){
			$SQLstr .= " and (length(UE_cardUser)>=1 or length(UE_cardID)>=1) and UE_cardState<>1";
		}elseif ($refCardState == 91){
			$SQLstr .= " and UE_cardState in (1,11,21)";
		}else{
			$SQLstr .= " and UE_cardState=". $refCardState;
		}
	}
	if ($refqq != ''){ $SQLstr .= " and UE_qq like '%". $refqq ."%'"; }
	if ($refww != ''){ $SQLstr .= " and UE_ww like '%". $refww ."%'"; }
	if ($refRegType != ''){
		$SQLstr .= " and UE_regType='". $refRegType ."'";
	}
	if ($refRegIP != ''){ $SQLstr .= " and UE_regIP like '%". $refRegIP ."%'"; }
	if ($refGroupDate1 != ''){ $SQLstr .= ' and UE_groupTime>='. $DB->ForTime($refGroupDate1); }
	if ($refGroupDate2 != ''){ $SQLstr .= ' and UE_groupTime<='. $DB->ForTime(TimeDate::Add('d',1,$refGroupDate2)); }
	if ($refDate1 != ''){ $SQLstr .= ' and UE_time>='. $DB->ForTime($refDate1); }
	if ($refDate2 != ''){ $SQLstr .= ' and UE_time<='. $DB->ForTime(TimeDate::Add('d',1,$refDate2)); }
	if ($refMailMode == 'no'){
		$SQLstr .= ' and LENGTH(UE_mail)<=3';
	}elseif ($refMailMode == 'noToQq'){
		$SQLstr .= " and UE_mail not like '%@%' and LENGTH(UE_qq)>=5";
	}elseif ($refMailMode == 'yes'){
		$SQLstr .= ' and LENGTH(UE_mail)>=4';
	}elseif ($refMailMode == 'repeat'){
		$SQLstr .= ' and LENGTH(UE_mail)>=1 and UE_mail in (select UE_mail from '. OT_dbPref .'users group by UE_mail having count(UE_mail) >= 2)';
		$orderName = 'mail';
	}
	if ($refPhoneMode == 'no'){
		$SQLstr .= ' and LENGTH(UE_phone)!=11';
	}elseif ($refPhoneMode == 'yes'){
		$SQLstr .= ' and LENGTH(UE_phone)==11';
	}elseif ($refPhoneMode == 'repeat'){
		$SQLstr .= ' and LENGTH(UE_phone)>=1 and UE_phone in (select UE_phone from '. OT_dbPref .'users group by UE_phone having count(UE_phone) >= 2)';
		$orderName = 'phone';
	}
	if ($refMark == 1){ $SQLstr .= ' and UE_event like "%|mark|%"'; }
	if ($refNoMail == 1){ $SQLstr .= ' and UE_event like "%|noMail|%"'; }
	if ($refNoPhone == 1){ $SQLstr .= ' and UE_event like "%|noPhone|%"'; }
	if ($refNoWeixin == 1){ $SQLstr .= ' and UE_event like "%|noWeixin|%"'; }
	if ($refApiQq == 1){ $SQLstr .= ' and UE_apiStr like "%|qq::%"'; }
	if ($refApiWeibo == 1){ $SQLstr .= ' and UE_apiStr like "%|weibo::%"'; }
	if ($refApiWeixin == 1){ $SQLstr .= ' and UE_apiStr like "%|weixin::%"'; }
	if ($refApiWxmp == 1){ $SQLstr .= ' and UE_weixinID>=1'; }
	if ($refLoginDate1 != ''){ $SQLstr .= ' and UE_loginTime>='. $DB->ForTime($refLoginDate1); }
	if ($refLoginDate2 != ''){ $SQLstr .= ' and UE_loginTime<='. $DB->ForTime(TimeDate::Add('d',1,$refLoginDate2)); }
	if ($refMoney_1 > -1){ $SQLstr .= ' and UE_money>='. $refMoney_1; }else{ $refMoney_1 = ''; }
	if ($refMoney_2 > -1){ $SQLstr .= ' and UE_money<='. $refMoney_2; }else{ $refMoney_2 = ''; }
	if ($refScore1_1 > -1){ $SQLstr .= ' and UE_score1>='. $refScore1_1; }else{ $refScore1_1 = ''; }
	if ($refScore1_2 > -1){ $SQLstr .= ' and UE_score1<='. $refScore1_2; }else{ $refScore1_2 = ''; }
	if ($refScore2_1 > -1){ $SQLstr .= ' and UE_score2>='. $refScore2_1; }else{ $refScore2_1 = ''; }
	if ($refScore2_2 > -1){ $SQLstr .= ' and UE_score2<='. $refScore2_2; }else{ $refScore2_2 = ''; }
	if ($refScore3_1 > -1){ $SQLstr .= ' and UE_score3>='. $refScore3_1; }else{ $refScore3_1 = ''; }
	if ($refScore3_2 > -1){ $SQLstr .= ' and UE_score3<='. $refScore3_2; }else{ $refScore3_2 = ''; }

	$orderName = OT::ListDefVal(OT::GetStr('orderName'), 'username|realname|groupID|mail|phone|weixin|qq|ww|state|regIP|loginTime|score1|score2|score3|regType|money|moneyGive|payMoney|domainNum|time', 'time');
	$orderSort = OT::ListDefVal(OT::GetStr('orderSort'), 'ASC', 'DESC');

	$groupOptionStr = '';

	$skin->TableTop('share_refer.gif','',$dataTypeCN .'查询');
		echo('
		<form id="refForm" name="refForm" method="get" action="">
		<input type="hidden" name="mudi" value="'. $mudi .'" />
		<input type="hidden" name="dataType" value="'. $dataType .'" />
		<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
		<input type="hidden" name="dataMode" value="'. $dataMode .'" />
		<input type="hidden" name="dataModeStr" value="'. $dataModeStr .'" />
		<table style="width:99%;" border="0" cellSpacing="0" cellPadding="0" summary="" class="padd3td">
		<tr>
			<td style="width:30%;">
				&ensp;&ensp;会员组：<select id="refGroupID" name="refGroupID" style="width:220px;">
				<option value="">&ensp;</option>
				');

				$gexe=$DB->query('select UG_ID,UG_theme from '. OT_dbPref .'userGroup where UG_state=1 order by UG_rank ASC');
				while ($row = $gexe->fetch()){
					echo('<option value="'. $row['UG_ID'] .'" '. Is::Selected($refGroupID,$row['UG_ID']) .'>'. $row['UG_theme'] .'</option>');
					$groupOptionStr .= '<option value="'. $row['UG_ID'] .'">'. $row['UG_theme'] .'</option>';
				}
				unset($gexe);

				echo('
				</select>&ensp;
			</td>
			<td style="width:17%;">
				用户名：<input type="text" name="refUsername" size="18" style="width:105px;" value="'. $refUsername .'" />
				<label title="打钩用户名全名搜索，不模糊搜索"><input type="checkbox" name="refIsFullName" value="1" '. Is::Checked($refIsFullName,1) .' />全名</label>
			</td>
			<td style="width:25%;">
				&ensp;&ensp;&ensp;&ensp;邮箱：<input type="text" name="refMail" size="18" style="width:105px;" value="'. $refMail .'" />
				<label><input type="checkbox" name="refAuthMail" value="1" '. Is::Checked($refAuthMail,1) .' />验证</label>
			</td>
			<td style="width:28%;">
				会员组到期：<input type="text" name="refGroupDate1" size="10" value="'. $refGroupDate1 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />&ensp;
				至&ensp;<input type="text" name="refGroupDate2" size="10" value="'. $refGroupDate2 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />
			</td>
		</tr>
		<tr>
			<td>
				&ensp;&ensp;注册IP：<input type="text" name="refRegIP" size="18" style="width:110px;" value="'. $refRegIP .'" />
				&ensp;&ensp;状态：<select id="refState" name="refState">
					<option value=""></option>
					<option value="1" '. Is::Selected($refState,1) .'>已审</option>
					<option value="0" '. Is::Selected($refState,0) .'>未审</option>
					<option value="9" '. Is::Selected($refState,9) .'>冻结</option>
					</select>
			</td>
			<td>
				&ensp;&ensp;昵称：<input type="text" name="refRealname" size="18" style="width:105px;" value="'. $refRealname .'" />
			</td>
			<td>
				&ensp;&ensp;&ensp;&ensp;手机：<input type="text" name="refPhone" size="18" style="width:105px;" value="'. $refPhone .'" />
				<label><input type="checkbox" name="refAuthPhone" value="1" '. Is::Checked($refAuthPhone,1) .' />验证</label>
			</td>
			<td>
				&ensp;&ensp;注册日期：<input type="text" name="refDate1" size="10" value="'. $refDate1 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />&ensp;
				至&ensp;<input type="text" name="refDate2" size="10" value="'. $refDate2 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />
			</td>
		</tr>
		<tr>
			<td>
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;QQ：<input type="text" name="refqq" size="18" style="width:79px;" value="'. $refqq .'" />
				&ensp;&ensp;旺旺：<input type="text" name="refww" size="18" style="width:79px;" value="'. $refww .'" />
			</td>
			<td>
				&ensp;&ensp;类型：<select id="refRegType" name="refRegType" style="width:110px;">
					<option value=""></option>
					<option value="web" '. Is::Selected($refRegType,'web') .'>网站</option>
					<option value="back" '. Is::Selected($refRegType,'back') .'>后台</option>
					<option value="qq" '. Is::Selected($refRegType,'qq') .'>QQ</option>
					<option value="weibo" '. Is::Selected($refRegType,'weibo') .'>新浪微博</option>
					<option value="weixin" '. Is::Selected($refRegType,'weixin') .'>微信</option>
					<!-- <option value="wxmp" '. Is::Selected($refRegType,'wxmp') .'>微信公众号</option>
					<option value="taobao" '. Is::Selected($refRegType,'taobao') .'>淘宝</option>
					<option value="alipay" '. Is::Selected($refRegType,'alipay') .'>支付宝</option> -->
					</select>
			</td>
			<td>
				快捷登录：<label><input type="checkbox" name="refApiQq" value="1" '. Is::Checked($refApiQq,1) .' />QQ</label>&ensp;
				<label><input type="checkbox" name="refApiWeibo" value="1" '. Is::Checked($refApiWeibo,1) .' />微博</label>&ensp;
				<label><input type="checkbox" name="refApiWeixin" value="1" '. Is::Checked($refApiWeixin,1) .' />微信</label>&ensp;
			</td>
			<td>
				&ensp;&ensp;最后登录：<input type="text" name="refLoginDate1" size="10" value="'. $refLoginDate1 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />&ensp;
				至&ensp;<input type="text" name="refLoginDate2" size="10" value="'. $refLoginDate2 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />
			</td>
		</tr>
		<tr>
			<td align="left">
				&ensp;&ensp;&ensp;&ensp;邮箱：<select id="refMailMode" name="refMailMode" style="width:auto;">
					<option value=""></option>
					<option value="no" '. Is::Selected($refMailMode,'no') .'>没有</option>
					<option value="noToQq" '. Is::Selected($refMailMode,'noToQq') .'>没有但有QQ</option>
					<option value="yes" '. Is::Selected($refMailMode,'yes') .'>有</option>
					<option value="repeat" '. Is::Selected($refMailMode,'repeat') .'>重复</option>
					</select>
				&ensp;&ensp;手机：<select id="refPhoneMode" name="refPhoneMode" style="width:auto;">
					<option value=""></option>
					<option value="no" '. Is::Selected($refPhoneMode,'no') .'>没有</option>
					<option value="yes" '. Is::Selected($refPhoneMode,'yes') .'>有</option>
					<option value="repeat" '. Is::Selected($refPhoneMode,'repeat') .'>重复</option>
					</select>
			</td>
			<td>
				&ensp;&ensp;实名：<input type="text" name="refShiming" size="18" style="width:50px;" value="'. $refShiming .'" />
				<select id="refCardState" name="refCardState" style="width:50px;">
					<option value=""></option>
					<option value="0" '. Is::Selected($refCardState,0) .'>未提交</option>
					<option value="2" '. Is::Selected($refCardState,2) .'>待审核</option>
					<option value="91" '. Is::Selected($refCardState,91) .'>所有审核通过</option>
					<option value="1" '. Is::Selected($refCardState,1) .'>手动审核通过</option>
					<option value="11" '. Is::Selected($refCardState,11) .'>微信实名认证</option>
					<option value="21" '. Is::Selected($refCardState,21) .'>支付宝实名认证</option>
					<option value="3" '. Is::Selected($refCardState,3) .'>审核拒绝</option>
					<option value="98" '. Is::Selected($refCardState,98) .'>[有内容未通过]</option>
					<option value="99" '. Is::Selected($refCardState,99) .'>[有内容]</option>
					</select>
			</td>
			<td align="left" colspan="2">
				&ensp;&ensp;'. $userSysArr['US_score1Name'] .'：<input type="text" name="refScore1_1" size="18" style="width:55px;" value="'. $refScore1_1 .'" />
				- <input type="text" name="refScore1_2" size="18" style="width:55px;" value="'. $refScore1_2 .'" />
				');
				if ($userSysArr['US_isScore2']==1){
					echo('&ensp;&ensp;&ensp;'. $userSysArr['US_score2Name'] .'：<input type="text" name="refScore2_1" size="18" style="width:55px;" value="'. $refScore2_1 .'" />
					- <input type="text" name="refScore2_2" size="18" style="width:55px;" value="'. $refScore2_2 .'" />');
				}
				if ($userSysArr['US_isScore3']==1){
					echo('&ensp;&ensp;&ensp;'. $userSysArr['US_score3Name'] .'：<input type="text" name="refScore3_1" size="18" style="width:55px;" value="'. $refScore3_1 .'" />
					- <input type="text" name="refScore3_2" size="18" style="width:55px;" value="'. $refScore3_2 .'" />');
				}
			echo('
			</td>
		</tr>
		<tr>
			<td align="center" style="padding-top:20px" colspan="4">
				<input type="image" src="'. AdmTpl::ImgSrc('button_refer') .'" onclick=\'RefFormSubmit("refer");\' />
				&ensp;&ensp;&ensp;&ensp;
				<img src="'. AdmTpl::ImgSrc('button_reset') .'" onclick=\'document.location.href="?mudi='. $mudi .'&amp;dataMode='. $dataMode .'&amp;dataModeStr='. $dataModeStr .'&amp;dataType='. $dataType .'&amp;dataTypeCN='. urlencode($dataTypeCN) .'"\' style="cursor:pointer" alt="" />
				'. AppUserExport::UsersRefBox() .'
				&ensp;&ensp;&ensp;&ensp;列表显示模式：<label><input type="radio" name="refListMode" value="def" '. Is::Checked($refListMode,'def') .' />默认</label>&ensp;&ensp;
					<label><input type="radio" name="refListMode" value="shiming" '. Is::Checked($refListMode,'shiming') .' />实名认证</label>&ensp;&ensp;
			</td>
		</tr>
		</table>
		</form>
		');
	$skin->TableBottom();

	echo('
	<br />

	<div style="padding:5px;float:left;">
		<div style="float:right;padding-right:8px;">
			<input type="button" value="批量更新文章数统计" onclick=\'var a=window.open("users_deal.php?mudi=updateCount");\' style="color:blue;" />
		</div>
		<input type="button" value="在线会员列表" onclick=\'document.location.href="?mudi=online&dataTypeCN='. urlencode('在线会员') .'";\' />&ensp;
		'. AppRecom::UsersBox1('&dataTypeCN='. urlencode('推荐注册会员')) .'&ensp;
		'. AppQiandao::UsersBox1('&dataTypeCN='. urlencode('签到会员')) .'&ensp;
		'. AppGain::UsersBox1('&dataTypeCN='. urlencode('推广提现会员')) .'&ensp;
	</div>

	<form id="listForm" name="listForm" method="post" action="users_deal.php?mudi=moreDel" onsubmit="return CheckListForm()">
	<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'">\')</script>
	<input type="hidden" name="dataType" value="'. $dataType .'" />
	<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
	<input type="hidden" name="dataMode" value="'. $dataMode .'" />
	<input type="hidden" name="dataModeStr" value="'. $dataModeStr .'" />
	');

	$skin->TableTop2('share_list.gif','',$dataTypeCN .'列表');

	$titleArr = array();
	$titleArr[] = array('width'=>'3%',	'name'=>'<input type="checkbox" id="selAll" name="selAll" onclick="CheckBoxAll()" />');
	$titleArr[] = array('width'=>'4%',	'name'=>'序号');
	$titleArr[] = array('width'=>'4%',	'name'=>'ID');
	$titleArr[] = array('width'=>'6%',	'name'=>$skin->ShowArrow('类型','regType',$orderName,$orderSort));
	$titleArr[] = array('width'=>'12%',	'name'=>$skin->ShowArrow('用户名','username',$orderName,$orderSort) .'/'. 
												$skin->ShowArrow('会员组','groupID',$orderName,$orderSort));
	$titleArr[] = array('width'=>'13%',	'name'=>$skin->ShowArrow('昵称','realname',$orderName,$orderSort) .'/'. 
												$skin->ShowArrow('邮箱','mail',$orderName,$orderSort) .'/'. 
												$skin->ShowArrow('手机','phone',$orderName,$orderSort) .'/'.
												'<span style="color:blue;">备注</span>');
	$titleArr[] = array('width'=>'11%',	'name'=>$skin->ShowArrow('QQ','qq',$orderName,$orderSort) .'/'. 
												$skin->ShowArrow('旺旺','ww',$orderName,$orderSort) .'/'. 
												$skin->ShowArrow('微信','weixin',$orderName,$orderSort));

	$modeFieldStr = '其他';
	if (in_array($refListMode, $listModeArr)){
		switch ($refListMode){
			case 'shiming':		$modeFieldStr = '实名认证';		break;
			default:			$modeFieldStr = '其他';			break;
		}
		$titleArr[] = array('width'=>'16%',	'name'=>$modeFieldStr);
	
	}else{
		$titleArr[] = array('width'=>'9%',	'name'=>$skin->ShowArrow('积分1','score1',$orderName,$orderSort) .'/'. 
													$skin->ShowArrow('2','score2',$orderName,$orderSort) .'/'. 
													$skin->ShowArrow('3','score3',$orderName,$orderSort));
		if (!AppMoneyRecord::Jud()){
			$refListMode = 'money';
			$titleArr[] = array('width'=>'7%',	'name'=>$skin->ShowArrow('余额','money',$orderName,$orderSort) .'/'. 
													$skin->ShowArrow('消费','payMoney',$orderName,$orderSort));
		}
	}

	$titleArr[] = array('width'=>'8%',	'name'=>$skin->ShowArrow('最后登录','loginTime',$orderName,$orderSort));
	$titleArr[] = array('width'=>'8%',	'name'=>$skin->ShowArrow('注册日期','time',$orderName,$orderSort));
	$titleArr[] = array('width'=>'5%',	'name'=>$skin->ShowArrow('状态','state',$orderName,$orderSort));
	$titleArr[] = array('width'=>'11%',	'name'=>'详细&ensp;修改&ensp;删除');
	$skin->TableTitleArr($titleArr);

	$pageSize	= $MB->mMbRow['MB_itemNum'];		//每页条数
	$page		= OT::GetInt('page');
	$showRow=$DB->GetLimit($SQLstr .' order by UE_'. $orderName .' '. $orderSort,$pageSize,$page);
	if (! $showRow){
		$usersCount = $DB->GetOne('select count(1) from '. OT_dbPref .'users');
		if ($usersCount == 0){
			$noAlert = '暂无内容<span style="color:#000;">（如要会员ID重置为1，请到【管理员专区】→【程序文件检查】-[SQL语句调试] 快捷指令：◆会员ID重置为1）</span>';
		}else{
			$noAlert = '暂无内容';
		}
		$skin->TableNoData($noAlert);
	}else{
		$recordCount=$DB->GetRowCount();
		$pageCount=ceil($recordCount/$pageSize);
		if ($page < 1 || $page > $pageCount){$page=1;}

		$userGroupArr = Cache::PhpFile('userGroup');
		$todayTime = TimeDate::Get();

		echo('
		<tbody class="tabBody padd3td">
		');
		$number=1+($page-1)*$pageSize;
		$rowCount = count($showRow);
		for ($i=0; $i<$rowCount; $i++){
			if ($i % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
			$recomStr = $groupTimeStr = $shimingStr = $mailStr = $phoneStr = $userAddi = '';
			if (AppRecom::Jud()){
				$recomStr = AppRecom::UsersTabStr($showRow[$i]['UE_recomId'], $showRow[$i]['UE_isRecomScore'], $showRow[$i]['UE_recomScore1'], $showRow[$i]['UE_recomScore2'], $showRow[$i]['UE_recomScore3']) . $showRow[$i]['UE_recomUser'];
			}

			if ($showRow[$i]['UE_isGroupTime']==1 && strtotime(''. $showRow[$i]['UE_groupTime'])){
				$groupTimeStr = '<span style="color:red;" title="到期时间：'. $showRow[$i]['UE_groupTime'] .'">['. TimeDate::DiffDayCN($showRow[$i]['UE_groupTime'],'') .']</span>';
			}

			if ($showRow[$i]['UE_cardState'] == 1){
				$shimingStr = '<span title="手动实名认证"><img src="images/img_shiming.png" style="margin-left:2px;" /></span>';
			}elseif ($showRow[$i]['UE_cardState'] == 11){
				$shimingStr = '<span title="微信扫码实名认证"><img src="images/img_shiming11.png" style="margin-left:2px;" /></span>';
			}elseif ($showRow[$i]['UE_cardState'] == 21){
				$shimingStr = '<span title="支付宝扫码实名认证"><img src="images/img_shiming21.png" style="margin-left:2px;" /></span>';
			}elseif ($showRow[$i]['UE_cardState'] == 3){
				$shimingStr = '<span title="实名拒绝"><img src="images/img_shiming3.png" style="margin-left:2px;" /></span>';
			}elseif ($showRow[$i]['UE_cardState'] == 2){
				$userAddi = '<div style="color:red;">【实名待审核】</div>';
			}
			if (strpos(''. $showRow[$i]['UE_authStr'],'|邮箱|') !== false){
				$mailStr = '<span title="邮箱已验证"><img src="images/img_yanzheng.png" style="margin-left:2px;" /></span>';
			}
			/* elseif ($userSysArr['US_isAuthMail'] == 1){
				$mailStr = '<span title="邮箱未验证" style="color:blue;">[未验]</span>';
			} */
			if (strpos(''. $showRow[$i]['UE_authStr'],'|手机|') !== false){
				$phoneStr = '<span title="手机已验证"><img src="images/img_yanzheng.png" style="margin-left:2px;" /></span>';
			}
			/* elseif ($userSysArr['US_isAuthPhone'] == 1){
				$phoneStr = '<span title="手机未验证" style="color:blue;">[未验]</span>';
			} */
			$apiStr = '';
			if (strpos(''. $showRow[$i]['UE_apiStr'],'|qq::') !== false){ $apiStr .= '<img src="images/api_qq.png" alt="已绑定QQ快捷登录" title="已绑定QQ快捷登录" />'; }
			if (strpos(''. $showRow[$i]['UE_apiStr'],'|weibo::') !== false){ $apiStr .= '<img src="images/api_weibo.png" alt="已绑定新浪微博快捷登录" title="已绑定新浪微博快捷登录" />'; }
			if (strpos(''. $showRow[$i]['UE_apiStr'],'|weixin::') !== false){ $apiStr .= '<img src="images/api_weixin.png" alt="已绑定微信快捷登录" title="已绑定微信快捷登录" />'; }
			if ($showRow[$i]['UE_weixinID'] >= 1){ $apiStr .= '<img src="images/api_wxmp.png" alt="已绑定微信公众号" title="已绑定微信公众号" />'; }

			echo('
			<tr '. $bgcolor .' id="data'. $showRow[$i]['UE_ID'] .'">
				<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $showRow[$i]['UE_ID'] .'" /></td>
				<td align="center">'. $number .'</td>
				<td align="center">'. $showRow[$i]['UE_ID'] .'</td>
				<td align="center">'. Users::RegTypeCN($showRow[$i]['UE_regType']) .'</td>
				<td align="center" style="word-break:break-all;">
					'. $showRow[$i]['UE_username'] . $shimingStr . $apiStr .'
					<div style="margin-top:5px;color:blue;">'. UserGroup::CurrName($showRow[$i]['UE_groupID'],$userGroupArr) . $groupTimeStr .'</div>
					'. $userAddi .'
				</td>
				<td align="center" style="word-break:break-all;">
					'. $showRow[$i]['UE_realname'] .'
					<div>'. $showRow[$i]['UE_mail'] . $mailStr .'</div>
					<div>'. $showRow[$i]['UE_phone'] . $phoneStr .'</div>
					<div style="color:blue;">'. $showRow[$i]['UE_adminNote'] .'</div>
				</td>
				<td align="center" style="word-break:break-all;">
					'. AdmArea::UserQQ($showRow[$i]['UE_qq']) .'
					'. AdmArea::UserWw($showRow[$i]['UE_ww']) .'
					<div>'. $showRow[$i]['UE_weixin'] .'</div>
					<div style="padding-top:5px;">'. $recomStr .'</div>
					<div style="padding-top:5px;">
						'. AppSiteMessage::AdminAddBtn($MB->mUserID, $showRow[$i]['UE_ID'], $showRow[$i]['UE_username']) .'
						'. AppGain::Show('<span style="color:#adacac;cursor:pointer;" onclick=\'var a=window.open("gainItem.php?mudi=userManage&userID='. $showRow[$i]['UE_ID'] .'&username='. $showRow[$i]['UE_username'] .'");\'>[加佣金]</span>') .'
					</div>
				</td>
				'. ListModeItem($refListMode, $showRow[$i]) .'
				<td align="center" title="'. $showRow[$i]['UE_loginTime'] .'">
					'. TimeDate::Get('date',$showRow[$i]['UE_loginTime']) .'
					<div class="font2_2">('. TimeDate::Diff('d',$showRow[$i]['UE_loginTime'],$todayTime) .'天前)</div>
					<div>'. AppUserScore::UsersItem($showRow[$i]["UE_ID"],'#c9c9c9') .'</div>
				</td>
				<td align="center" style="color:'. (TimeDate::Diff('d',$showRow[$i]['UE_time'],$todayTime)==0?'red':'') .';">
					'. $showRow[$i]['UE_time'] .'
				</td>
				<td align="center">
					<select id="state'. $showRow[$i]['UE_ID'] .'" name="state'. $showRow[$i]['UE_ID'] .'" onchange=\'SetState("'. $showRow[$i]['UE_ID'] .'")\' style="color:'. StateColor($showRow[$i]['UE_state']) .';">
						<option value="1" style="color:#0066CC;" '. Is::Selected($showRow[$i]['UE_state'],1) .'>已审核</option>
						<option value="0" style="color:red;" '. Is::Selected($showRow[$i]['UE_state'],0) .'>未审核</option>
						<option value="9" style="color:#707070;" '. Is::Selected($showRow[$i]['UE_state'],9) .'>冻结</option>
					</select>
					<div id="state'. $showRow[$i]['UE_ID'] .'Res" style="color:green;"></div>
				</td>
				<td align="center">
					<img src="images/img_det.gif" style="cursor:pointer" onclick=\'var a=window.open("?mudi=show&nohrefStr=close&dataMode='. $dataMode .'&dataModeStr='. $dataModeStr .'&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataID='. $showRow[$i]['UE_ID'] .'")\' alt="" />&ensp;&ensp;
					<img src="images/img_rev.gif" style="cursor:pointer" onclick=\'document.location.href="?mudi=rev&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataMode='. $dataMode .'&dataID='. $showRow[$i]['UE_ID'] .'&backURL="+ encodeURIComponent(document.location.href)\' alt="" />&ensp;
					<img src="images/img_del.gif" style="cursor:pointer" onclick=\'if(confirm("你确定要删除？")==true){DataDeal.location.href="users_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($showRow[$i]['UE_username']) .'&dataID='. $showRow[$i]['UE_ID'] .'"}\' alt="" />
				</td>
			</tr>
			');
			// '. Adm::SwitchBtn('users',$showRow[$i]['UE_ID'],$showRow[$i]['UE_state'],'state','stateAudit') .'
			$number ++;
		}
	echo('
	</tbody>
	<tr class="tabColorB padd5td">
		<td align="left" colspan="20">
			<input type="button" value="全选" class="tabBottomBtn allSel" onclick="AllSelBox()" />
			<input type="button" value="反选" class="tabBottomBtn revSel" onclick="RevSelBox()" />
			&ensp;
			<input type="submit" value="批量删除" class="tabBottomBtn del" />
			&ensp;&ensp;
			<select id="moreSetTo" name="moreSetTo" onchange="MoreSetTo()" style="width:150px;">
				<option value="">批量设置成...</option>
				<option value="shiming0" style="color:#707070;">实名：未提交</option>
				<option value="shiming2" style="color:;">实名：待审核（仅针对 手动审核通过、审核拒绝）</option>
				<option value="shiming1" style="color:#0066CC;">实名：手动审核通过√（仅针对 待审核）</option>
				<option value="shiming3" style="color:red;">实名：审核拒绝ㄨ（仅针对 待审核）</option>
				<option value="mailAudit1" style="color:#0066CC;">邮箱已验证√</option>
				<option value="mailAudit0" style="color:#707070;">邮箱未验证ㄨ</option>
				<option value="phoneAudit1" style="color:#0066CC;">手机已验证√</option>
				<option value="phoneAudit0" style="color:#707070;">手机未验证ㄨ</option>
				<option value="groupTime1" style="color:#0066CC;">开启会员组到期时间√</option>
				<option value="groupTime0" style="color:#707070;">关闭会员组到期时间ㄨ</option>
				<option value="state1" style="color:#0066CC;">状态：已审核√</option>
				<option value="state0" style="color:red;">状态：未审核ㄨ</option>
				<option value="state9" style="color:#707070;">状态：冻结</option>
			</select>
			<input type="hidden" id="moreSetToCN" name="moreSetToCN" value="" />
			&ensp;&ensp;&ensp;
			<select id="groupMoveTo" name="groupMoveTo" onchange="GroupMoveTo()" style="width:150px;">
				<option value="">会员组批量移动到...</option>
				'. $groupOptionStr .'
			</select>
			<input type="hidden" id="groupMoveToCN" name="groupMoveToCN" value="" />
		</td>
	</tr>
	');
	}
	unset($showRow);

	echo('</form>');

	$skin->TableBottom2($pageCount, $pageSize, $recordCount);
}



function online(){
	global $DB,$MB,$skin,$mudi,$dataType,$dataTypeCN,$pageCount,$recordCount,$userSysArr;

	$dataMode		= OT::GetStr('dataMode');
	$dataModeStr	= OT::GetStr('dataModeStr');

	$refGroupID		= OT::GetInt('refGroupID');
	$refUsername	= OT::GetRegExpStr('refUsername','sql');
	$refMail		= OT::GetRegExpStr('refMail','sql+mail');
	$refPhone		= OT::GetRegExpStr('refPhone','sql');
	$refRecomUser	= OT::GetRegExpStr('refRecomUser','sql');
	$refqq			= OT::GetRegExpStr('refqq','sql');
	$refRegIP		= OT::GetRegExpStr('refRegIP','sql+.');
	$refState		= OT::GetInt('refState',-1);
	$refDate1		= OT::GetStr('refDate1');
		if (! strtotime($refDate1)){ $refDate1=''; }
	$refDate2		= OT::GetStr('refDate2');
		if (! strtotime($refDate2)){ $refDate2=''; }

	$onTime = TimeDate::Add('min',-60);
	$SQLstr = 'select * from '. OT_dbPref .'users as UE RIGHT JOIN '. OT_dbPref .'userOnline as UO ON UE.UE_ID=UO.UO_userID where UO.UO_time>='. $DB->ForTime($onTime);

	if ($refGroupID > 0){ $SQLstr .= ' and UE_groupID='. $refGroupID .''; }
	if ($refState >= 0){ $SQLstr .= ' and UE_state='. $refState .''; }
	if ($refUsername != ''){ $SQLstr .= " and UE_username like '%". $refUsername ."%'"; }
	if ($refMail != ''){ $SQLstr .= " and UE_mail like '%". $refMail ."%'"; }
	if ($refPhone != ''){ $SQLstr .= " and UE_phone like '%". $refPhone ."%'"; }
	if ($refqq != ''){ $SQLstr .= " and UE_qq like '%". $refqq ."%'"; }
	if ($refRegIP != ''){ $SQLstr .= " and UE_regIP like '%". $refRegIP ."%'"; }
	if ($refDate1 != ''){ $SQLstr .= ' and UE_time>='. $DB->ForTime($refDate1); }
	if ($refDate2 != ''){ $SQLstr .= ' and UE_time<='. $DB->ForTime(TimeDate::Add('d',1,$refDate2)); }

	$orderName = OT::ListDefVal(OT::GetStr('orderName'), 'UE_regType|UE_username|UE_groupID|UE_mail|UE_phone|UE_weixin|UE_qq|UE_ww|UE_state|UE_time|UO_time|UO_ip', 'UO_time');
	$orderSort = OT::ListDefVal(OT::GetStr('orderSort'), 'ASC', 'DESC');

	echo(AdmArea::TopBackBtn('users.php?mudi=manage&dataMode='. $dataMode .'&dataModeStr='. $dataModeStr .'&dataType='. $dataType .'&dataTypeCN='. urlencode('会员'), '返回 会员管理'));

	$skin->TableTop('share_refer.gif','',$dataTypeCN .'查询');
		echo('
		<form id="refForm" name="refForm" method="get" action="">
		<input type="hidden" name="mudi" value="'. $mudi .'" />
		<input type="hidden" name="dataType" value="'. $dataType .'" />
		<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
		<input type="hidden" name="dataMode" value="'. $dataMode .'" />
		<input type="hidden" name="dataModeStr" value="'. $dataModeStr .'" />
		<table style="width:99%;" border="0" cellSpacing="0" cellPadding="0" summary="" class="padd5td">
		<tr>
			<td style="width:22%;">
				&ensp;&ensp;会员组：<select id="refGroupID" name="refGroupID" style="width:139px;">
				<option value="">&ensp;</option>
				');

				$gexe=$DB->query('select UG_ID,UG_theme from '. OT_dbPref .'userGroup where UG_state=1 order by UG_rank ASC');
				while ($row = $gexe->fetch()){
					echo('<option value="'. $row['UG_ID'] .'" '. Is::Selected($refGroupID,$row['UG_ID']) .'>'. $row['UG_theme'] .'</option>');
				}
				unset($gexe);

				echo('
				</select>&ensp;
			</td>
			<td style="width:22%;">
				&ensp;&ensp;用户名：<input type="text" name="refUsername" size="18" style="width:135px;" value="'. $refUsername .'" />
			</td>
			<td style="width:22%;">
				&ensp;&ensp;&ensp;&ensp;邮箱：<input type="text" name="refMail" size="18" style="width:135px;" value="'. $refMail .'" />
			</td>
			<td style="width:34%;">
				审核状态：<select name="refState">
					<option value="">&ensp;</option>
					<option value="1" '. Is::Selected($refState,1) .'>已审核</option>
					<option value="0" '. Is::Selected($refState,0) .'>未审核</option>
					<option value="9" '. Is::Selected($refState,9) .'>冻结</option>
					</select>
				<!-- &ensp;&ensp;&ensp;&ensp;状态：<select id="refState" name="refState">
					<option value=""></option>
					<option value="1" '. Is::Selected($refState,1) .'>已审</option>
					<option value="0" '. Is::Selected($refState,0) .'>未审</option>
					</select> -->
			</td>
		</tr>
		<tr>
			<td>
				&ensp;&ensp;邀请人：<input type="text" name="refRecomUser" size="18" style="width:135px;" value="'. $refRecomUser .'" />
			</td>
			<td>
				&ensp;&ensp;&ensp;&ensp;&ensp;QQ：<input type="text" name="refqq" size="18" style="width:135px;" value="'. $refqq .'" />
			</td>
			<td>
				&ensp;&ensp;&ensp;&ensp;手机：<input type="text" name="refPhone" size="18" style="width:135px;" value="'. $refPhone .'" />
			</td>
			<td>
				注册日期：<input type="text" name="refDate1" size="10" value="'. $refDate1 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />&ensp;
				至&ensp;<input type="text" name="refDate2" size="10" value="'. $refDate2 .'" onfocus="WdatePicker({dateFmt:\'yyyy-MM-dd\'})" />
			</td>
		</tr>
		<tr>
			<td align="center" style="padding-top:20px" colspan="4">
				<input type="image" src="'. AdmTpl::ImgSrc('button_refer') .'" />
				&ensp;&ensp;&ensp;&ensp;
				<img src="'. AdmTpl::ImgSrc('button_reset') .'" onclick=\'document.location.href="?mudi='. $mudi .'&amp;dataMode='. $dataMode .'&amp;dataModeStr='. $dataModeStr .'&amp;dataType='. $dataType .'&amp;dataTypeCN='. urlencode($dataTypeCN) .'"\' style="cursor:pointer" alt="" />
			</td>
		</tr>
		</table>
		</form>
		');
	$skin->TableBottom();

	echo('
	<div style="padding:6px;">您前台会员ID：<span style="color:blue;">'. Users::GetCookies('userID') .'</span>，用户名：<span style="color:blue;">'. Users::GetCookies('username') .'</span>，IP地址：<span style="color:blue;">'. Users::GetIp() .'</span></div>

	<form id="listForm" name="listForm" method="post" onsubmit="return CheckListForm()">
	<script language="javascript" type="text/javascript">document.write(\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'">\')</script>
	<input type="hidden" name="dataType" value="'. $dataType .'" />
	<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
	<input type="hidden" name="dataMode" value="'. $dataMode .'" />
	<input type="hidden" name="dataModeStr" value="'. $dataModeStr .'" />
	');

	$skin->TableTop2('share_list.gif','',$dataTypeCN .'列表');
	$skin->TableItemTitle('3%,5%,6%,14%,14%,12%,13%,16%,8%,5%,5%','<input type="checkbox" id="selAll" name="selAll" onclick="CheckBoxAll()" />,序号,'. $skin->ShowArrow('注册类型','UE_regType',$orderName,$orderSort) .','. $skin->ShowArrow('用户名','UE_username',$orderName,$orderSort) .'/'. $skin->ShowArrow('会员组','UE_groupID',$orderName,$orderSort) .','. $skin->ShowArrow('邮箱','UE_mail',$orderName,$orderSort) .','. $skin->ShowArrow('QQ','UE_qq',$orderName,$orderSort) .'/'. $skin->ShowArrow('旺旺','UE_ww',$orderName,$orderSort) .','. $skin->ShowArrow('最后在线时间','UO_time',$orderName,$orderSort) .','. $skin->ShowArrow('在线IP','UO_ip',$orderName,$orderSort) .','. $skin->ShowArrow('注册日期','UE_time',$orderName,$orderSort) .','. $skin->ShowArrow('状态','UE_state',$orderName,$orderSort) .',详细');

	$pageSize	= $MB->mMbRow['MB_itemNum'];		//每页条数
	$page		= OT::GetInt('page');
	$showRow=$DB->GetLimit($SQLstr .' order by '. $orderName .' '. $orderSort,$pageSize,$page);
	if (! $showRow){
		$skin->TableNoData();
	}else{
		$recordCount=$DB->GetRowCount();
		$pageCount=ceil($recordCount/$pageSize);
		if ($page < 1 || $page > $pageCount){$page=1;}

		$userGroupArr = Cache::PhpFile('userGroup');
		$todayTime = TimeDate::Get();

		echo('
		<tbody class="tabBody padd3td">
		');
		$number=1+($page-1)*$pageSize;
		$rowCount = count($showRow);
		for ($i=0; $i<$rowCount; $i++){
			if ($i % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
			$recomStr = '';
			if (AppRecom::Jud()){
				$recomStr = AppRecom::UsersTabStr($showRow[$i]['UE_recomId'], $showRow[$i]['UE_isRecomScore']) . $showRow[$i]['UE_recomUser'];
			}

			$ipInfoArr = OT::GetIpInfoArr($showRow[$i]['UO_ip']);

			echo('
			<tr '. $bgcolor .' id="data'. $showRow[$i]['UE_ID'] .'">
				<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $showRow[$i]['UE_ID'] .'" /></td>
				<td align="center">'. $number .'</td>
				<td align="center">'. Users::RegTypeCN($showRow[$i]['UE_regType']) .'</td>
				<td align="center" style="word-break:break-all;">
					'. $showRow[$i]['UE_username'] .'&ensp;<span title="会员ID">['. $showRow[$i]['UE_ID'] .']</span>
					<div style="margin-top:5px;color:blue;">'. UserGroup::CurrName($showRow[$i]['UE_groupID'],$userGroupArr) .'</div>
				</td>
				<td align="center" style="word-break:break-all;">
					'. $showRow[$i]['UE_mail'] .'
					<div style="padding-top:2px;">'. AppSiteMessage::AdminAddBtn($MB->mUserID, $showRow[$i]['UE_ID'], $showRow[$i]['UE_username'], '', '', '[发站内信息]') .'</div>
				</td>
				<td align="center" style="word-break:break-all;">
					'. AdmArea::UserQQ($showRow[$i]['UE_qq']) .'
					'. AdmArea::UserWw($showRow[$i]['UE_ww']) .'
				</td>
				<td align="center">'. $showRow[$i]['UO_time'] .'<div style="color:red;">（'. TimeDate::Diff('min',$showRow[$i]['UO_time']) .'分钟前）</div></td>
				<td align="center">'. $showRow[$i]['UO_ip'] .'<div style="color:blue;">（'. $ipInfoArr['address'] .'）</div></td>
				<td align="center">'. $showRow[$i]['UE_time'] .'</td>
				<td align="center">'. Adm::SwitchBtn('users',$showRow[$i]['UE_ID'],$showRow[$i]['UE_state'],'state','stateAudit') .'</td>
				<td align="center">
					<img src="images/img_det.gif" style="cursor:pointer" onclick=\'var a=window.open("?mudi=show&nohrefStr=close&dataMode='. $dataMode .'&dataModeStr='. $dataModeStr .'&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataID='. $showRow[$i]['UE_ID'] .'")\' alt="" />
				</td>
			</tr>
			');
			$number ++;
		}
	echo('
	</tbody>
	<tr class="tabColorB padd5td">
		<td align="left" colspan="20">
			<input type="button" value="全选" class="tabBottomBtn allSel" onclick="AllSelBox()" />
			<input type="button" value="反选" class="tabBottomBtn revSel" onclick="RevSelBox()" />
			&ensp;
			<input type="submit" value="批量删除" class="tabBottomBtn del" />
		</td>
	</tr>
	');
	}
	unset($showRow);

	echo('</form>');

	$skin->TableBottom2($pageCount, $pageSize, $recordCount);
}



function show(){
	global $DB,$MB,$skin,$dataType,$dataTypeCN,$userSysArr;

	$dataID		= OT::GetInt2( OT::ParaArr('id') );
	$dataMode	= OT::GetStr('dataMode');
	$dataModeStr= OT::GetStr('dataModeStr');

/*
暂时没用到
UE_onlineMinute	int	11	0	0	0	0	0	0	0	0					0	0
UE_faceMode	tinyint	3	0	0	0	-1	0	0	0	0					0	0
UE_face	varchar	255	0	-1	0	0	0	0		0		utf8	utf8_general_ci		0	0
UE_fieldStr	text	0	0	-1	0	0	0	0		0		utf8	utf8_general_ci		0	0
UE_recomIdList	text	0	0	-1	0	0	0	0		0		utf8	utf8_general_ci		0	0
UE_recomNum3	int	10	0	-1	0	-1	0	0	0	0					0	0
UE_recomNum13	int	10	0	-1	0	-1	0	0	0	0					0	0
UE_tbOrderMoney	decimal	10	2	-1	0	0	0	0	0.00	0					0	0
UE_workTime	datetime	0	0	-1	0	0	0	0		0					0	0
UE_apiKey	varchar	255	0	-1	0	0	0	0		0		utf8	utf8_general_ci		0	0
UE_apiUserID	int	11	0	-1	0	0	0	0	0	0					0	0
UE_tbOrderTail	varchar	20	0	-1	0	0	0	0		0	暂时无用	utf8	utf8_general_ci		0	0
UE_addMoney	decimal	10	2	-1	0	0	0	0	0.00	0	暂时无用				0	0
UE_event	varchar	255	0	-1	0	0	0	0		0		utf8	utf8_general_ci		0	0
*/

	$showexe=$DB->query('select * from '. OT_dbPref .'users where UE_ID='. $dataID);
	if (! $row = $showexe->fetch()){
		JS::AlertCloseEnd('指定ID错误！');
	}else{
		echo('
		<script language="javascript" type="text/javascript">document.title="会员详细信息";</script>
		<table style="width:900px;" align="center" cellpadding="0" cellspacing="0" border="0" summary=""><tr><td>
		');
		$skin->TableTop('share_list.gif','','会员详细信息');

		$userGroupArr = Cache::PhpFile('userGroup');

		$groupTimeStr = $shimingStr = $authMailStr = $authPhoneStr = '';
		if ($row['UE_isGroupTime']==1 && strtotime($row['UE_groupTime'])){
			$groupTimeStr = '<span style="color:red;" title="到期时间：'. $row['UE_groupTime'] .'">['. TimeDate::DiffDayCN($row['UE_groupTime'],'') .']</span>';
		}

		if ($row['UE_cardState'] == 1){
			$shimingStr = '&ensp;<span title="手动实名认证"><img src="images/img_shiming.png" /></span>';
		}elseif ($row['UE_cardState'] == 11){
			$shimingStr = '&ensp;<span title="微信扫码实名认证"><img src="images/img_shiming11.png" /></span>';
		}elseif ($row['UE_cardState'] == 21){
			$shimingStr = '&ensp;<span title="支付宝扫码实名认证"><img src="images/img_shiming21.png" /></span>';
		}

		if ($userSysArr['US_isAuthMail'] == 1 && AppMail::Jud()){
			if (strpos(''. $row['UE_authStr'],'|邮箱|') === false){
				$authMailStr = '&ensp;<span style="font-size:12px;color:red;">[未验证]</span>';
			}else{
				$authMailStr = '&ensp;<span style="font-size:12px;color:green;">[已验证]</span>';
			}
		}

		if ($userSysArr['US_isAuthPhone'] == 1 && AppPhone::Jud()){
			if (strpos(''. $row['UE_authStr'],'|手机|') === false){
				$authPhoneStr = '&ensp;<span style="font-size:12px;color:red;">[未验证]</span>';
			}else{
				$authPhoneStr = '&ensp;<span style="font-size:12px;color:green;">[已验证]</span>';
			}
		}

		$ipInfoArr = OT::GetIpInfoArr($row['UE_regIP']);

		echo('
		<div style="float:left;width:440px;">
			<table style="width:100%;" align="center" cellpadding="0" cellspacing="0" border="0" summary="" class="padd3">
			<tr>
				<td align="right" width="100">注册时间：</td>
				<td>'. $row['UE_time'] .'</td>
			</tr>
			<tr>
				<td align="right">注册类型：</td>
				<td>'. Users::RegTypeCN($row['UE_regType']) .'</td>
			</tr>
			<tr>
				<td align="right">注册IP：</td>
				<td>'. $row['UE_regIP'] .'&ensp;&ensp;（'. $ipInfoArr['address'] .'）</td>
			</tr>
			<tr>
				<td align="right">最后登录时间：</td>
				<td>'. $row['UE_loginTime'] .'</td>
			</tr>
			<tr>
				<td align="right">最后登录IP：</td>
				<td>'. $row['UE_loginIP'] .'</td>
			</tr>
			<tr>
				<td align="right">登录次数：</td>
				<td>'. $row['UE_loginNum'] .'</td>
			</tr>
			<tr>
				<td align="right">密码问题：</td>
				<td>'. $row['UE_question'] .'</td>
			</tr>
			<tr>
				<td align="right">用户组：</td>
				<td>'. UserGroup::CurrName($row['UE_groupID'],$userGroupArr) . $groupTimeStr .'</td>
			</tr>
			<tr>
				<td align="right">用户ID：</td>
				<td>'. $row['UE_ID'] .'</td>
			</tr>
			<tr>
				<td align="right">用户名：</td>
				<td>'. $row['UE_username'] . $shimingStr .'</td>
			</tr>
			<tr>
				<td align="right">昵称：</td>
				<td>'. $row['UE_realname'] .'</td>
			</tr>
			<tr>
				<td align="right">邮箱：</td>
				<td>'. $row['UE_mail'] . $authMailStr .'</td>
			</tr>
			<tr>
				<td align="right">手机：</td>
				<td>'. $row['UE_phone'] . $authPhoneStr .'</td>
			</tr>
			');
			$levelWhereStr = '';
	//		if ($userSysArr['US_isScore1']==1){
				$levelWhereStr .= ' and UL_score1<='. $row['UE_score1'];
				echo('
				<tr>
					<td align="right">'. $userSysArr['US_score1Name'] .'：</td>
					<td>'. $row['UE_score1'] .'</td>
				</tr>
				');
	//		}
			if ($userSysArr['US_isScore2']==1){
				$levelWhereStr .= ' and UL_score2<='. $row['UE_score2'];
				echo('
				<tr>
					<td align="right">'. $userSysArr['US_score2Name'] .'：</td>
					<td>'. $row['UE_score2'] .'</td>
				</tr>
				');
			}
			if ($userSysArr['US_isScore3']==1){
				$levelWhereStr .= ' and UL_score3<='. $row['UE_score3'];
				echo('
				<tr>
					<td align="right">'. $userSysArr['US_score3Name'] .'：</td>
					<td>'. $row['UE_score3'] .'</td>
				</tr>
				');
			}
			$levelRow = $DB->GetRow('select UL_num,UL_themeStyle,UL_theme,UL_img from '. OT_dbPref .'userLevel where (1=1)'. $levelWhereStr .' order by UL_num DESC limit 1');
			echo('
			<tr>
				<td style="padding:3px;" align="right" valign="top">等级：</td>
				<td style="padding:3px;" align="left">
					['. $levelRow['UL_num'] .'级] <span style="'. $levelRow['UL_themeStyle'] .'">'. $levelRow['UL_theme'] .'</span><br />
					<img src="'. UsersFileAdminDir . $levelRow['UL_img'] .'" />
				</td>
			</tr>
			');
			unset($levelRow);

			$apiStr = $btnStr = '';
			if (strpos(''. $row['UE_apiStr'],'|qq::') !== false){
				$apiStr .= '<div>【QQ】<span style="color:red;cursor:pointer;" onclick=\'if (confirm("你确定要解除QQ绑定？")){ DataDeal.location.href="users_deal.php?mudi=revInfo&mode=apiStr&type=qq&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username'] .'解除QQ绑定') .'&userID='. $row['UE_ID'] .'"; }\'>[解除绑定]</span></div>';
			}
			if (strpos(''. $row['UE_apiStr'],'|weibo::') !== false){
				$apiStr .= '<div>【新浪微博】<span style="color:red;cursor:pointer;" onclick=\'if (confirm("你确定要解除新浪微博绑定？")){ DataDeal.location.href="users_deal.php?mudi=revInfo&mode=apiStr&type=weibo&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username'] .'解除新浪微博绑定') .'&userID='. $row['UE_ID'] .'"; }\'>[解除绑定]</span></div>';
			}
			if (strpos(''. $row['UE_apiStr'],'|weixin::') !== false){
				$apiStr .= '<div>【微信】<span style="color:red;cursor:pointer;" onclick=\'if (confirm("你确定要解除微信绑定？")){ DataDeal.location.href="users_deal.php?mudi=revInfo&mode=apiStr&type=weixin&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username'] .'解除微信绑定') .'&userID='. $row['UE_ID'] .'"; }\'>[解除绑定]</span></div>';
			}
			if ($row['UE_weixinID'] >= 1){
				$apiStr .= '<div>【微信公众号】</div>';
			}

			if (AppMoneyRecord::Jud()){
				$btnStr .= '<input type="button" value="财务管理" style="margin-left:2px;" onclick=\'OT_OpenUserMoney("&userID='. $dataID .'")\' />';
			}
			if (AppMoneyPay::Jud()){
				$btnStr .= '<input type="button" value="充值记录" style="margin-left:2px;" onclick=\'var a=window.open("moneyPay.php?mudi=export&dataType=&dataTypeCN='. urlencode('在线支付统计') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppDiyPay::Jud()){
				$btnStr .= '<input type="button" value="手动充值记录" style="margin-left:2px;" onclick=\'var a=window.open("diyPayData.php?mudi=manage&dataTypeCN='. urlencode('手动充值') .'&refUsername='. urlencode($row['UE_username']) .'&refState=-1&refIsPay=-1");\' />';
			}
			if (AppUserScore::Jud()){
				$btnStr .= '<input type="button" value="积分管理" style="margin-left:2px;" onclick=\'OT_OpenUserScore("&userID='. $dataID .'")\' />';
			}
			if (AppSiteMessage::Jud()){
				// $btnStr .= '<input type="button" value="发站内信息" style="margin-left:2px;" onclick=\'var a=window.open("../siteMessage.php?mudi=add&mid='. $MB->mUserID .'&userID='. $dataID .'&username='. urlencode($row['UE_username']) .'");\' />';
				$btnStr .= '<input type="button" value="发站内信息" style="margin-left:2px;" onclick=\'var a=window.open("../wap/users/w.php?m=siteMessageAdd&mid='. $MB->mUserID .'&userID='. $dataID .'&username='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppMail::Jud()){
				$btnStr .= '<input type="button" value="邮件发送记录" style="margin-left:2px;" onclick=\'var a=window.open("mailTpl.php?mudi=users&dataTypeCN='. urlencode('邮件发送记录') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppPhone::Jud()){
				$btnStr .= '<input type="button" value="短信发送记录" style="margin-left:2px;" onclick=\'var a=window.open("phoneTpl.php?mudi=users&dataTypeCN='. urlencode('短信发送记录') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppUserView::Jud()){
				$btnStr .= '<input type="button" value="会员浏览记录" style="margin-left:2px;" onclick=\'var a=window.open("userView.php?mudi=manage&dataTypeCN='. urlencode('会员浏览记录') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppUserMark::Jud()){
				$btnStr .= '<input type="button" value="会员收藏记录" style="margin-left:2px;" onclick=\'var a=window.open("userMark.php?mudi=manage&dataTypeCN='. urlencode('会员收藏记录') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppInfoDown::Jud()){
				$btnStr .= '<input type="button" value="会员下载记录" style="margin-left:2px;" onclick=\'var a=window.open("infoDown.php?mudi=manage&dataTypeCN='. urlencode('会员下载记录') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppTaokeOrder::Jud()){
				$btnStr .= '<input type="button" value="淘客订单" style="margin-left:2px;" onclick=\'var a=window.open("taokeOrder.php?mudi=manage&dataTypeCN='. urlencode('淘客订单') .'&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			if (AppGain::Jud()){
				$btnStr .= '<input type="button" value="加佣金" style="margin-left:2px;" onclick=\'var a=window.open("gainItem.php?mudi=userManage&userID='. $row['UE_ID'] .'&username='. urlencode($row['UE_username']) .'");\' /><input type="button" value="提现记录" style="margin-left:2px;" onclick=\'OT_OpenGainMoney("&refUsername='. urlencode($row['UE_username']) .'");\' />';
			}
			echo('
			<tr>
				<td align="right">文章数量：</td>
				<td>'. $row['UE_newsCount'] .'</td>
			</tr>
			<tr>
				<td align="right">余额：</td>
				<td>'. $row['UE_money'] .'</td>
			</tr>
			<tr>
				<td align="right">消费：</td>
				<td>'. $row['UE_payMoney'] .'</td>
			</tr>
			<tr>
				<td align="right" valign="top" style="padding-top:6px;">快捷登录：</td>
				<td style="line-height:1.4;">'. $apiStr .'</td>
			</tr>
			<tr>
				<td align="right">实名状态：</td>
				<td>'. CardStateCN($row['UE_cardState']) .'</td>
			</tr>
			<tr>
				<td align="right">实名类型：</td>
				<td>'. $row['UE_cardType'] .'</td>
			</tr>
			<tr>
				<td align="right">实名'. ($row['UE_cardType'] == '营业执照' ? '公司名称' : '姓名') .'：</td>
				<td>'. $row['UE_cardUser'] .'</td>
			</tr>
			<tr>
				<td align="right">实名'. ($row['UE_cardType'] == '营业执照' ? '公司税号' : '身份证号') .'：</td>
				<td>'. $row['UE_cardID'] .'</td>
			</tr>
			<tr>
				<td align="right" valign="top" style="padding-top:6px;">实名'. ($row['UE_cardType'] == '营业执照' ? '营业执照' : '身份证') .'：</td>
				<td>'. (strlen(''. $row['UE_cardImg']) > 0 ? '
						<a href="'. Info::InfoImgUrl($row['UE_cardImg'],UsersFileAdminDir) .'" target="_blank" title="点击看原图"><img src="'. Info::InfoImgUrl($row['UE_cardImg'],UsersFileAdminDir) .'" style="max-width:200px;max-height:200px;" /></a>
					' : '
					') .'
				</td>
			</tr>
			<tr>
				<td align="right">实名其他信息：</td>
				<td>'. $row['UE_cardImg2'] .'</td>
			</tr>
			<tr>
				<td align="right">附加信息：</td>
				<td>'. $row['UE_authStr'] .'</td>
			</tr>
			<!-- <tr>
				<td align="right">传真：</td>
				<td>'. $row['UE_fax'] .'</td>
			</tr> -->
			<tr>
				<td align="right">Q&ensp;Q：</td>
				<td>'. $row['UE_qq'] .'</td>
			</tr>
			<tr>
				<td align="right">旺旺：</td>
				<td>'. $row['UE_ww'] .'</td>
			</tr>
			<tr>
				<td align="right">微信：</td>
				<td>'. $row['UE_weixin'] .'</td>
			</tr>
			<tr>
				<td align="right">支付宝：</td>
				<td>'. $row['UE_alipay'] .'</td>
			</tr>
			<tr>
				<td align="right">性别：</td>
				<td>'. $row['UE_sex'] .'</td>
			</tr>
			<tr>
				<td align="right">城市：</td>
				<td>'. $row['UE_city'] .'</td>
			</tr>
			<tr>
				<td align="right">收货地址：</td>
				<td>'. $row['UE_address'] .'</td>
			</tr>
			<tr>
				<td align="right">邮编：</td>
				<td>'. $row['UE_postCode'] .'</td>
			</tr>
			<tr>
				<td align="right">网址：</td>
				<td>'. $row['UE_web'] .'</td>
			</tr>
			<tr>
				<td valign="top" align="right">前台备注：</td>
				<td>'. $row['UE_note'] .'</td>
			</tr>
			<tr>
				<td valign="top" align="right">内部备注：</td>
				<td>'. $row['UE_adminNote'] .'</td>
			</tr>
			<tr>
				<td valign="top" align="right">PC列表页数：</td>
				<td>'. $row['UE_pageNum'] .'</td>
			</tr>
			<tr>
				<td valign="top" align="right">WAP列表页数：</td>
				<td>'. $row['UE_pageWapNum'] .'</td>
			</tr>
			<tr>
				<td align="right">状态：</td>
				<td>
					<select id="selectState" name="selectState">
					<option value="0" '. Is::Selected($row['UE_state'],0) .'>未审核</option>
					<option value="1" '. Is::Selected($row['UE_state'],1) .'>已审核</option>
					<option value="9" '. Is::Selected($row['UE_state'],9) .'>冻结</option>
					</select>
					<input type="submit" value="设置" onclick=\'DataDeal.location.href="users_deal.php?mudi=revInfo&mode=state&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username']) .'&userID='. $row['UE_ID'] .'&state="+ document.getElementById("selectState").value\' />
				</td>
			</tr>
			</table>
		</div>
		<div style="float:left;width:430px;">
			<style>
			.fieldBox	{ margin-top:6px; }
			.fieldTitle	{ color:red; }
			</style>
			');

			if (AppQiandao::Jud()){
				echo('
				<fieldset class="fieldBox">
					<legend class="fieldTitle"> 签到 </legend>
				<table style="width:100%;" align="center" cellpadding="0" cellspacing="0" border="0" summary="" class="padd3">
				<tr><td width="100"></td><td></td></tr>
				<tr>
					<td align="right">最后签到时间：</td>
					<td>
						<input type="text" id="qiandaoTime" name="qiandaoTime" size="22" style="width:170px;" value="'. $row['UE_qiandaoTime'] .'" onfocus=\'WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"})\' class="Wdate" />
						<input type="submit" value="设置" onclick=\'DataDeal.location.href="users_deal.php?mudi=revInfo&mode=qiandaoTime&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username']) .'&userID='. $row['UE_ID'] .'&qiandaoTime="+ document.getElementById("qiandaoTime").value\' />
					</td>
				</tr>
				<tr>
					<td align="right" class="font1_2d">连续签到次数：</td>
					<td>'. $row['UE_qiandaoNum'] .'</td>
				</tr>
				<tr>
					<td align="right" class="font1_2d">签到总次数：</td>
					<td>'. $row['UE_qiandaoTotal'] .'</td>
				</tr>
				</table>
				</fieldset>
				');
			}

			if (AppRecom::Jud()){
				echo('
				<fieldset class="fieldBox">
					<legend class="fieldTitle"> 邀请人 </legend>
				<table style="width:100%;" align="center" cellpadding="0" cellspacing="0" border="0" summary="" class="padd3">
				<tr><td width="100"></td><td></td></tr>
				');
				if ($row['UE_recomId'] > 0){
					echo('
					<tr>
						<td align="right">邀请最后更新：</td>
						<td>
							<input type="text" id="recomTime" name="recomTime" size="22" style="width:170px;" value="'. $row['UE_recomTime'] .'" onfocus=\'WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"})\' class="Wdate" />
							<input type="submit" value="设置" onclick=\'DataDeal.location.href="users_deal.php?mudi=revInfo&mode=recomTime&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username']) .'&userID='. $row['UE_ID'] .'&recomTime="+ document.getElementById("recomTime").value\' />
						</td>
					</tr>
					<tr>
						<td align="right" class="font1_2d">邀请级别：</td>
						<td>'. $row['UE_recomLevel'] .'</td>
					</tr>
					<tr>
						<td align="right" class="font1_2d">邀请方式：</td>
						<td>'. AppRecom::RecomTypeCN($row['UE_recomType']) .'</td>
					</tr>
					<tr>
						<td align="right" class="font1_2d">邀请人：</td>
						<td>'. $row['UE_recomUser'] .'（ID：'. $row['UE_recomId'] .'）'. AdmArea::UserInfoImg($row['UE_recomId']) .'</td>
					</tr>
					<tr>
						<td align="right">邀请人获得：</td>
						<td>'. ($row['UE_isRecomScore'] == 1 ? '
								积分1：'. $row['UE_recomScore1'] .'，积分2：'. $row['UE_recomScore2'] .'，积分3：'. $row['UE_recomScore3'] .'
							' : '
								<span style="color:red;">未获得积分</span>
							') .'
						</td>
					</tr>
					');
				}else{
					echo('
					<tr>
						<td align="right">邀请人：</td>
						<td>无</td>
					</tr>
					');
				}
				echo('
				<tr>
					<td align="right">更换邀请人：</td>
					<td>
						<input type="text" id="recomUserNew" name="recomUserNew" size="22" style="width:170px;" value="" />
						<input type="submit" value="确定" onclick=\'DataDeal.location.href="users_deal.php?mudi=revInfo&mode=recomUser&nohrefStr=close&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['UE_username']) .'&userID='. $row['UE_ID'] .'&recomUser="+ document.getElementById("recomUserNew").value\' />
					</td>
				</tr>
				<tr>
					<td align="right" class="font1_2d">1级总人数：</td>
					<td>'. $row['UE_recomNum1'] .'</td>
				</tr>
				<tr>
					<td align="right" class="font1_2d">1级有效人数：</td>
					<td>'. $row['UE_recomNum11'] .'</td>
				</tr>
				<tr>
					<td align="right" class="font1_2d">2级总人数：</td>
					<td>'. $row['UE_recomNum2'] .'</td>
				</tr>
				<tr>
					<td align="right" class="font1_2d">2级有效人数：</td>
					<td>'. $row['UE_recomNum12'] .'</td>
				</tr>
				</table>
				</fieldset>
				');
			}

			if (AppGain::Jud()){
				echo('
				<fieldset class="fieldBox">
					<legend class="fieldTitle"> 推广提现 </legend>
				<table style="width:100%;" align="center" cellpadding="0" cellspacing="0" border="0" summary="" class="padd3">
				<tr><td width="100"></td><td></td></tr>
				<tr>
					<td align="right">未结算金额：</td>
					<td>'. $row['UE_makingMoney'] .'</td>
				</tr>
				<tr>
					<td align="right">可提现金额：</td>
					<td>'. $row['UE_makeMoney'] .'</td>
				</tr>
				<tr>
					<td align="right">已提现金额：</td>
					<td>'. $row['UE_makedMoney'] .'</td>
				</tr>
				</table>
				</fieldset>
				');
			}

			if (AppDashang::Jud()){
				echo('
				<fieldset class="fieldBox">
					<legend class="fieldTitle"> 打赏 </legend>
				<table style="width:100%;" align="center" cellpadding="0" cellspacing="0" border="0" summary="" class="padd3">
				<tr><td width="100"></td><td></td></tr>
				<tr>
					<td align="right">收款码1：</td>
					<td>'. $row['UE_dashangImg1'] .'</td>
				</tr>
				<tr>
					<td align="right">收款码2：</td>
					<td>'. $row['UE_dashangImg2'] .'</td>
				</tr>
				<tr>
					<td align="right">收款码3：</td>
					<td>'. $row['UE_dashangImg3'] .'</td>
				</tr>
				</table>
				</fieldset>
				');
			}

			if (AppWeixin::Jud() && $row['UE_weixinID'] > 0){
				echo('
				<fieldset class="fieldBox">
					<legend class="fieldTitle"> 微信公众号绑定 </legend>
				<table style="width:100%;" align="center" cellpadding="0" cellspacing="0" border="0" summary="" class="padd3">
				<tr><td width="100"></td><td></td></tr>
				<tr>
					<td align="right">微信绑定时间：</td>
					<td>'. $row['UE_weixinTime'] .'</td>
				</tr>
				<tr>
					<td align="right">微信昵称：</td>
					<td>'. $DB->GetOne('select WU_nickname from '. OT_dbPref .'weixinUsers where WU_ID='. $row['UE_weixinID']) .'</td>
				</tr>
				</table>
				</fieldset>
				');
			}

			echo('
			</table>

			<div style="padding:6px;line-height:2.2;">
				<input type="button" value="修改资料" style="color:red;"  onclick=\'document.location.href="?mudi=rev&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataMode='. $dataMode .'&dataID='. $dataID .'&nohrefStr=close&backURL="+ encodeURIComponent(document.location.href)\' />'. $btnStr .'
			</div>
		</div>
		');

		$skin->TableBottom();

		$todayDate = TimeDate::Get();
		$pageSize = 5;
		$page = 1;

		if (AppMail::Jud()){
			echo('<div style="height:8px;"></div>');

			$skin->TableTop2('share_list.gif','','邮件提醒前5条');
			$skin->TableItemTitle('6%,9%,19%,46%,13%,7%','序号,类型,邮箱,模板,发送时间,状态');

			$showRow=$DB->GetLimit('select * from '. OT_dbPref .'mailUsers where MU_userID='. $dataID .' order by MU_time DESC',$pageSize,$page);
			if (! $showRow){
				$skin->TableNoData();
			}else{
				$recordCount=$DB->GetRowCount();
				$pageCount=ceil($recordCount/$pageSize);
				if ($page < 1 || $page > $pageCount){$page=1;}

				echo('
				<tbody class="tabBody padd3td">
				');
				$number=1+($page-1)*$pageSize;
				$rowCount = count($showRow);
				for ($i=0; $i<$rowCount; $i++){
					if ($i % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }

					echo('
					<tr id="data'. $showRow[$i]['MU_ID'] .'" '. $bgcolor .'>
						<td align="center">'. $number .'</td>
						<td align="center">'. TypeCN($showRow[$i]['MU_type']) .'</td>
						<td align="center">'. $showRow[$i]['MU_mail'] .'</td>
						<td align="left" title="模板ID：'. $showRow[$i]['MU_userID'] .'">'. $showRow[$i]['MU_tplTheme'] .'</td>
						<td align="center" style="color:'. (TimeDate::Diff('d',$showRow[$i]['MU_time'],$todayDate)==0?'red':'') .';">'. $showRow[$i]['MU_time'] .'</td>
						<td align="center">'. Adm::SwitchCN($showRow[$i]['MU_state'],'sign','') .'</td>
					</tr>
					');
					$number ++;
				}
				echo('
				</tbody>
				');
			}
			unset($showRow);

			echo('</table>');
		}

		if (AppPhone::Jud()){
			echo('<div style="height:8px;"></div>');

			$skin->TableTop2('share_list.gif','','短信提醒前5条');
			$skin->TableItemTitle('6%,9%,19%,46%,13%,7%','序号,类型,手机,模板,发送时间,状态');

			$showRow=$DB->GetLimit('select * from '. OT_dbPref .'phoneUsers where PU_userID='. $dataID .' order by PU_time DESC',$pageSize,$page);
			if (! $showRow){
				$skin->TableNoData();
			}else{
				$recordCount=$DB->GetRowCount();
				$pageCount=ceil($recordCount/$pageSize);
				if ($page < 1 || $page > $pageCount){$page=1;}

				echo('
				<tbody class="tabBody padd3td">
				');
				$number=1+($page-1)*$pageSize;
				$rowCount = count($showRow);
				for ($i=0; $i<$rowCount; $i++){
					if ($i % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }

					echo('
					<tr id="data'. $showRow[$i]['PU_ID'] .'" '. $bgcolor .'>
						<td align="center">'. $number .'</td>
						<td align="center">'. TypeCN($showRow[$i]['PU_type']) .'</td>
						<td align="center">'. $showRow[$i]['PU_phone'] .'</td>
						<td align="center" title="模板ID：'. $showRow[$i]['PU_userID'] .'">'. $showRow[$i]['PU_tplTheme'] .'</td>
						<td align="center" style="color:'. (TimeDate::Diff('d',$showRow[$i]['PU_time'],$todayDate)==0?'red':'') .';">'. $showRow[$i]['PU_time'] .'</td>
						<td align="center">'. Adm::SwitchCN($showRow[$i]['PU_state'],'sign','') .'</td>
					</tr>
					');
					$number ++;
				}
				echo('
				</tbody>
				');
			}
			unset($showRow);

			echo('</table>');
		}
		echo('
		</td></tr></table>
		');
	}

}

function TypeCN($str){
	switch ($str){
		case 'reg':		return '注册';
		case 'check':	return '验证';
		case 'rev':		return '更换';
		case 'missPwd':	return '找回密码';
		default :		return is_numeric($str)?'':$str;
	}
}

function CardStateCN($num){
	switch ($num){
		case 0:		return '未提交';
		case 1:		return '手动审核通过';
		case 2:		return '待审核';
		case 3:		return '审核拒绝';
		case 11:	return '微信实名';
		case 21:	return '支付宝实名';
		default :	return '['. $num .']';
	}
}

function ListModeItem($refListMode, $row){
	$retStr = '';
	if ($refListMode == 'shiming'){
		// 实名认证
		$retStr .= '
			<td align="left" style="word-break:break-all;">
				<div>图片：'. (strlen(''. $row['UE_cardImg'])>0 ? '<a href="'. Info::InfoImgUrl($row['UE_cardImg'],UsersFileAdminDir) .'" target="_blank" title="点击看原图" style="color:red;">【点击查看图片】</a>' : '无') .'</div>
				<div>类型：'. $row['UE_cardType'] .'</div>
				<div>姓名：'. $row['UE_cardUser'] .'</div>
				<div>证号：'. $row['UE_cardID'] .'</div>
				<div>其他：<span style="color:green;">'. $row['UE_cardImg2'] .'</span></div>
				<div>状态：'. CardStateCN($row['UE_cardState']) .'</div>
			</td>
			';
	}else{
		$retStr .= '<td align="left">'. Area::UserScoreList($row['UE_score1'],$row['UE_score2'],$row['UE_score3']) .'</td>';
		if ($refListMode == 'money'){
			// 财务
			$retStr .= '
				<td align="center">
					<div style="float:right;text-align:right;">
						'. $row['UE_money'] .'
						<div style="color:blue;">'. $row['UE_payMoney'] .'</div>
					</div>
					<div class="clr"></div>
					<div>'. AppMoneyRecord::UsersItem($row["UE_ID"],'#c9c9c9') .'</div>
				</td>
				';
		}
	}
	return $retStr;
}


function StateColor($num){
	if ($num == 0){
		return 'red';
	}elseif ($num == 1){
		return '#0066CC';
	}elseif ($num == 9){
		return '#707070';
	}
}
?>